package kuaizu.common.template;

import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author: wangmx15
 * @date: 2025/8/24
 * 项目管理者同意消息的模版
 **/
@Data
public class ProjectYaoQingMassageTemp {
    private thing1 thing1;
    private thing2 thing2;
    private phrase3 phrase3;
    private time4 time4;
    private thing5 thing5;

    @Data
    public static class thing1 {
        private String value;
    }
    @Data
    public static class thing2 {
        private String value;
    }
    @Data
    public static class phrase3 {
        private String value;
    }
    @Data
    public static class time4 {
        private String value;
    }
    @Data
    public static class thing5 {
        private String value;
    }
    public void setTemplateParam(String projectName, boolean status,String name) {
        this.thing1 = new ProjectYaoQingMassageTemp.thing1();
        this.thing2 = new ProjectYaoQingMassageTemp.thing2();
        this.phrase3 = new ProjectYaoQingMassageTemp.phrase3();
        this.time4 = new ProjectYaoQingMassageTemp.time4();
        this.thing5 = new ProjectYaoQingMassageTemp.thing5();
//设置语句
        //当前时间 yyyy-MM-dd HH:mm:ss
        String time = new SimpleDateFormat("yyyy年MM月dd HH:mm").format(new Date());
        time4.setValue(time);
        thing2.setValue(name);
        if (projectName.length()>20) {
            String substring = projectName.substring(0, 16);
            projectName=substring+"...";
        }
        thing1.setValue(projectName);
        if (status) {
            phrase3.setValue("同意加入");
            thing5.setValue("恭喜找到属于自己的小队!!");
        } else {
            phrase3.setValue("拒绝加入");
            thing5.setValue("提示:我们还有非常多的亮眼项目");
        }
    }

}
